﻿@model LoginModel
@using Nop.Web.Models.Customer;
@using Nop.Core;
@using Nop.Core.Infrastructure;
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.Login").Text);

    //register URL with return URL (if specified)
    var registerUrl = Url.RouteUrl("Register");
    if (!String.IsNullOrEmpty(this.Context.Request.QueryString["returnUrl"]))
    {
        var webHelper = EngineContext.Current.Resolve<IWebHelper>();
        registerUrl = webHelper.ModifyQueryString(registerUrl, "returnurl=" + HttpUtility.UrlEncode(this.Context.Request.QueryString["returnUrl"]), null);
    }
}
<div class="panel panel-default form-panel">
    <div class="panel-heading">
        <h3>@T("Account.Login.Welcome")</h3>
    </div>
    @Html.Partial("_ExternalAuthentication.AssociateMessage")
    @Html.Partial("_ExternalAuthentication.Errors")
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                @if (Model.CheckoutAsGuest)
                {
                    <div class="title mid-content-title">
                        <strong>@T("Account.Login.CheckoutAsGuestOrRegister")</strong>
                    </div>
                    <div class="offer offer-default">
                        <div class="text">
                            @Html.Action("TopicBlock", "Topic", new { systemName = "CheckoutAsGuestOrRegister" })
                        </div>
                        <div class="buttons">
                            <input type="button" class="button-1 checkout-as-guest-button btn btn-default" onclick="location.href='@Url.RouteUrl("Checkout")'" value="@T("Account.Login.CheckoutAsGuest")" />
                            <input type="button" class="button-1 register-button btn btn-default" onclick="location.href='@registerUrl'" value="@T("Account.Register")" />
                        </div>
                    </div>
                }
                else
                {
                    <div class="title mid-content-title">
                        <strong>@T("Account.Login.NewCustomer")</strong>
                    </div>
                    <div class="offer offer-default">
                        <div class="text">
                            @T("Account.Login.NewCustomerText")
                        </div>
                        <div class="buttons">
                            <input type="button" class="button-1 register-button btn btn-default" onclick="location.href='@registerUrl'" value="@T("Account.Register")" />
                        </div>
                    </div>
                    
                }
            </div>
            <div class="col-md-6">
                <div class="title mid-content-title">
                    <strong>@T("Account.Login.ReturningCustomer")</strong>
                </div>
                <div class="offer offer-default">
                    <div class="">
                        @using (Html.BeginForm())
                        {
                            <div class="text-danger">
                                @Html.ValidationSummary(true, T("Account.Login.Unsuccessful").Text)
                            </div>
                            if (Model.UsernamesEnabled)
                            {
                                <div class="form-group row">
                                    <div class="col-md-3">
                                        @Html.LabelFor(m => m.Username, new { @class = "control-label" }, ":")
                                    </div>    
                                    <div class="col-md-9">
                                        @Html.TextBoxFor(m => m.Username, new { @class = "username form-control", autofocus = "autofocus" })
                                    </div>
                                    @Html.ValidationMessageFor(m => m.Username)
                                </div>
                            }
                            else
                            {
                                <div class="form-group row">
                                    <div class="col-md-3">
                                        @Html.LabelFor(m => m.Email, new { @class = "control-label" }, ":")
                                    </div>
                                    <div class="col-md-9">
                                        @Html.TextBoxFor(m => m.Email, new { @class = "email form-control", autofocus = "autofocus" })
                                    </div>
                                    @Html.ValidationMessageFor(m => m.Email)
                                </div>
                            }
                            <div class="form-group row">
                                <div class="col-md-3">
                                    @Html.LabelFor(m => m.Password, new { @class = "control-label" }, ":")
                                </div>
                                <div class="col-md-9">
                                    @Html.PasswordFor(m => m.Password, new { @class = "password form-control" })
                                </div>
                                @Html.ValidationMessageFor(m => m.Password)
                            </div>
                            <div class="form-group reversed">
                                @Html.CheckBoxFor(m => m.RememberMe)
                                @Html.LabelFor(m => m.RememberMe)
                                <span class="forgot-password">
                                    @Html.RouteLink(T("Account.Login.ForgotPassword").Text, "PasswordRecovery")
                                </span>
                            </div>
                            if (Model.DisplayCaptcha)
                            {
                                <div class="captcha-box">
                                    @Html.Raw(Html.GenerateCaptcha())
                                </div>
                            }
                            <div class="buttons">
                                <input class="button-1 login-button btn btn-default" type="submit" value="@T("Account.Login.LoginButton")" />
                            </div>
                       
                        }
                    </div>
                </div>
            </div>
        </div>




@Html.Action("ExternalMethods", "ExternalAuthentication") 
        
@*@if (!String.IsNullOrEmpty(@Html.Action("ExternalMethods", "ExternalAuthentication").ToString()))
{
    <div class="row">
        <div class="col-md-12">
            <div class="external-authentication">
                <div class="offer offer-default">
                     @Html.Action("ExternalMethods", "ExternalAuthentication")  
                </div>
            </div>
        </div>
            
    </div>

}*@

         
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        @Html.Action("TopicBlock", "Topic", new { systemName = "LoginRegistrationInfo" })
    </div>
</div>
